#!/usr/bin/env python
# vim:fileencoding=utf-8

from calibre.web.feeds.news import BasicNewsRecipe


class PravdaUARU(BasicNewsRecipe):
    title = '\u0423\u043A\u0440\u0430\u0438\u043D\u0441\u043A\u0430\u044F \u043F\u0440\u0430\u0432\u0434\u0430'
    __author__ = 'bugmen00t'
    description = '\u0418\u043D\u0442\u0435\u0440\u043D\u0435\u0442-\u0438\u0437\u0434\u0430\u043D\u0438\u0435, \u043E\u0441\u043D\u043E\u0432\u043D\u0430\u044F \u0442\u0435\u043C\u0430\u0442\u0438\u043A\u0430 \u2014 \u043F\u043E\u043B\u0438\u0442\u0438\u043A\u0430, \u0441\u043E\u0446\u0438\u0430\u043B\u044C\u043D\u044B\u0435 \u043F\u0440\u043E\u0431\u043B\u0435\u043C\u044B, \u044D\u043A\u043E\u043D\u043E\u043C\u0438\u043A\u0430. '  # noqa
    publisher = 'pravda.com.ua'
    category = 'newspaper'
    cover_url = u'https://img.pravda.com/images/up_for_fb.gif'
    language = 'ru'
    no_stylesheets = False
    remove_javascript = False
    auto_cleanup = False
    oldest_article = 7
    max_articles_per_feed = 30

    remove_tags_before = dict(name='h1')

    remove_tags_after = dict(name='article', attrs={'class': 'post'})

    remove_tags = [
        dict(name='footer'),
        dict(name='div', attrs={'class': 'nts-video-wrapper'}),
        dict(name='div', attrs={'class': 'post-report'}),
        dict(name='div', attrs={'class': 'post__report'}),
        dict(name='div', attrs={'class': 'social_item'}),
        dict(name='div', attrs={'class': 'sidebar'}),
        dict(
            name='div',
            attrs={
                'class':
                'article-announcement-photo article-announcement-photo-block-1'
            }
        ),
        dict(
            name='div',
            attrs={'class': 'statistic-bottom-block statistic-top-block'}
        ),
        dict(name='div', attrs={'class': 'modal modal_search modal_white'}),
        dict(name='div', attrs={'class': 'modal_auth modal_white'}),
        dict(name='div', attrs={'class': 'main_logo'}),
        dict(name='div', attrs={'class': 'footer_banner'}),
        dict(name='nav', attrs={'class': 'block block_menu'}),
        dict(name='div', attrs={'class': 'pagewrap page-point'}),
        dict(name='div', attrs={'class': 'modal fade search-popup'}),
        dict(name='div', attrs={'data-vr-zone': 'Mobile main menu'}),
        dict(name='aside'),
        dict(name='div', attrs={'class': 'block_related'}),
        dict(name='div', attrs={'class': 'block_comments'}),
        dict(name='div', attrs={'class': 'post_tags'}),
        dict(name='div', attrs={'class': 'post__tags'})
    ]

    feeds = [
        (
            '\u0412\u0441\u0435 \u043C\u0430\u0442\u0435\u0440\u0438\u0430\u043B\u044B',
            'https://www.pravda.com.ua/rus/rss/'
        ),
        (
            '\u0413\u043B\u0430\u0432\u043D\u044B\u0435 \u043D\u043E\u0432\u043E\u0441\u0442\u0438',
            'https://www.pravda.com.ua/rus/rss/view_mainnews/'
        ),
        (
            '\u041D\u043E\u0432\u043E\u0441\u0442\u0438',
            'https://www.pravda.com.ua/rus/rss/view_news/'
        ),
        (
            '\u041F\u0443\u0431\u043B\u0438\u043A\u0430\u0446\u0438\u0438',
            'https://www.pravda.com.ua/rus/rss/view_pubs/'
        ),
    ]
